package com.member.web.controller.shop;

import com.member.common.annotation.Log;
import com.member.common.core.controller.BaseController;
import com.member.common.core.domain.AjaxResult;
import com.member.common.core.page.TableDataInfo;
import com.member.common.enums.BusinessType;
import com.member.shop.domain.SysBizUser;
import com.member.shop.service.ISysBizUserService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 【用户列】控制器 [注册会员审核列表]
 *
 * @author lixinchen
 * @version 1.0
 * @date 2024-01-03
 **/
@RestController
@RequestMapping("/shop/user/process")
public class SysBizUserProcessController extends BaseController {
    @Resource
    private ISysBizUserService sysBizUserService;

    /**
     * 查询用户列列表
     */
    @PreAuthorize("@ss.hasPermi('shop:userProcess:list')")
    @GetMapping("/list")
    public TableDataInfo list(SysBizUser sysBizUser) {
        startPage();
        List<SysBizUser> list = sysBizUserService.selectSysBizUserProcessList(sysBizUser);
        return getDataTable(list);
    }

    /**
     * 审核
     */
    @PreAuthorize("@ss.hasPermi('shop:userProcess:edit')")
    @Log(title = "用户列", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody SysBizUser sysBizUser) {
        return toAjax(sysBizUserService.processSysBizUser(sysBizUser));
    }
}
